<div class="pageHeader">
    <form id="pagerForm" action="__URL__" method="post">

        <input type="hidden" name="account" value="{$_REQUEST.account}"/>
        <input type="hidden" name="orderField" value="{$_REQUEST.orderField}">
        <input type="hidden" name="orderDirection" value="{$_REQUEST.orderDirection}">
        <input type="hidden" name="pageNum" value="{$_REQUEST['pageNum']|default=1}"/>
        <input type="hidden" name="numPerPage" value="{$numPerPage}"/>


    </form>
    <form onsubmit="return navTabSearch(this);"  class="form-inline" action="__URL__" method="post">
        <div class="form-group">
            <label>卡号查询：</label><input type="text" value="{$_REQUEST.account}" name="card_id" class="form-control" size="15" />
        </div>
        <div class="form-group">
            <label>运营商查询：</label>
            <?php  $yunying = M('yunying'); $res = $yunying->select();?>
            <select class="form-control" name="yunying_id">
                <option value="">所有运营商</option>
                <volist id="yun" name="res">
                    <option value="{$yun.id}">{$yun.name}</option>
                </volist>
            </select>
        </div>
        <div class="form-group">
            <?php  $users = M('user'); $ret = $users->select();?>
            <select class="form-control" name="daili_id">
                <option value="">所有代理</option>
                <volist id="daili" name="ret">
                    <option value="{$daili.id}">{$daili.nickname}</option>
                </volist>
            </select>
        </div>
        <div class="form-group">
            <?php  $users = M('user'); $ret = $users->select();?>
            <select class="form-control" name="status">
                <option value="">所有状态</option>
                <option value="1">开机</option>
                <option value="2">关机</option>
                <option value="3">断网</option>
                <option value="4">取消断网</option>

            </select>
        </div>
        <div class="form-group">

        </div>
        <div class="form-group">
            <button type="submit" class="btn btn-warning btn-sm"><i class="icon-search"></i> 查询</button>
            <a class="btn btn-primary btn-sm" href="javascript:navTab.reload('', {clearQuery:true});"><i class="icon-undo"></i> 清空查询</a>
            <a href="__URL__/add" target="dialog" rel="useradd" mask="true" minable="true" width="500" height="400" class="btn btn-primary btn-sm"><i class="icon-plus"></i>批量新增</a>

        </div>
        <div class="pull-right btn-group">
            <button data-toggle="dropdown" class="btn btn-success dropdown-toggle btn-sm" type="button"><i class="icon-list"></i> 批量操作<span class="caret"></span></button>
            <ul role="menu" class="dropdown-menu">
                <div class="log-arrow-up"></div>
                <li><a href="__URL__/outxls/ids/all" target="dwzExport">导出<span style="color: green;">全部</span></a></li>
                <li><a href="__URL__/outxls" target="checkedExport" idname="ids">导出<span style="color: red;">选中</span></a></li>
                <li class="divider"></li>
                <li><a href="__URL__/selectedDelete"  title="确定要删除选中信息吗？" target="checkedAjaxTodo" idname="ids">删除选中</a></li>
            </ul>
        </div>
        <div class="form-group">
            <select class="form-control" name="daili_ids" id="sele">
                <option value>所有代理</option>
                <volist id="daili" name="ret">
                    <option value="{$daili.id}">{$daili.nickname}</option>
                </volist>
            </select>
        </div>
        <script>
            $("#sele").change(function(){
                var daili_id = $("#sele").find("option:selected").val();
               /* var url =  $('#pl').attr('href');*/
                var new_url ='__URL__/turn_daili?daili_id='+daili_id;
                $('#pl').attr('href',new_url);
            });
        </script>
        <a href="__URL__/turn_daili?daili_id=" class="btn btn-warning btn-sm" title="确定要更换选中卡号吗？" target="checkedAjaxTodo" idname="ids" id="pl">批量更换代理</a>
        <div class="form-group">
            <select class="form-control" name="daili" id="sele1">
                <option value>批量操作选择</option>
                <option value="singleCutNet">开机</option>
                <option value="disabledNumber">关机</option>
                <option value="DEL">断网</option>
                <option value="ADD">取消断网</option>
            </select>
        </div>
        <script>
            $("#sele1").change(function(){
                var status = $("#sele1").find("option:selected").val();
                /* var url =  $('#pl').attr('href');*/
                var new_url ='__URL__/more_caozuo?status='+status;
                $('#pl1').attr('href',new_url);
            });
        </script>
        <a href="__URL__/more_caozuo" class="btn btn-warning btn-sm" title="确定要批量操作吗？" target="checkedAjaxTodo" idname="ids" id="pl1">批量操作</a>
    </form>
    <br>

</div>



<div class="pageContent">
    <table class="j-table" width="100%" layoutH="95">
        <thead>
            <tr>
                <th width="30"><input type="checkbox" class="checkboxCtrl j-icheck" group="ids"></th>
                <th>编号</th>
                <th>卡号</th>
                <th>代理</th>
                <th>运营商</th>
                <th>套餐名称</th>
                <th>状态</th>
                <th>详细信息</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
           <volist id="vo" name="list">
            <tr>
                <td>
                    <input type="checkbox" name="ids" class="j-icheck" value="{$vo['id']}">
                </td>
                <td>{$vo['id']}</td>
                <td>{$vo['card_id']}</td>
                <td>
                    <?php
           $user = M('user')->where(array(id =>$vo['daili_id']))->find();
                    echo $user['nickname'];
                    ?>
                    ({$vo['daili_id']})
                </td>
                <td>
                    <?php
           $yunying = M('yunying')->where(array(id =>$vo['yunying_id']))->find();
                    echo $yunying['name'];
                    ?>
                </td>
                <td>
                    <?php
       $taocan = M('taocan')->where(array(id =>$vo['taocan_id']))->find();
                    echo $taocan['name'];
                    ?>
                </td>
                <td>
                   <if condition="$vo['status'] eq 0">
                     无状态
                       <elseif condition="$vo['status'] eq 1"/>开机
                       <elseif condition="$vo['status'] eq 2"/>关机
                       <elseif condition="$vo['status'] eq 3"/>断网
                       <elseif condition="$vo['status'] eq 4"/>取消断网
                   </if>
                </td>
                <td>
                    <if condition="$vo['number'] neq 0">
                        名称:{$vo['accu_name']}<br>
                        CA:{$vo['cumulation_already']} CL:{$vo['cumulation_left']}CT:{$vo['cumulation_total']}<br>
                        开始时间: <?php echo substr($vo['start_time'], 0, -6);?>结束时间:<?php echo substr($vo['end_time'], 0, -6);?><br>
                        unit_name:{$vo['unit_name']}&nbsp;&nbsp;&nbsp;&nbsp;group_transactionid:{$vo['group_transactionid']}
                        <else /> 暂无
                    </if>
                </td>
                <td>{$vo['create_time']|date="Y-m-d h:i:s",###}</td>

                <td>
                  <div class="btn-group  btn-group-xs">  
                    <a href="__URL__/edit/id/{$vo['id']}/navTabId/{:CONTROLLER_NAME}"   class="btn btn-primary" target="dialog"  mask="true"  width="500" height="400" ><i class="icon-edit"></i> 编辑</a>
                    <a href="__URL__/foreverdelete/id/{$vo['id']}/navTabId/{:CONTROLLER_NAME}" class="btn btn-danger" target="ajaxTodo" title="确定要删除该行信息吗？"><i style="font-size:12px;" class="icon-trash"></i> 删除</a>
                      <if condition="$vo['yunying_id'] eq 4">
                          <a href="__URL__/telecom_bootup/access_number/{$vo['card_id']}/yunying_name/{$yunying['name']}/jiekou_name/open"   class="btn btn-primary" target="dialog"  mask="true"   width="250" height="100" ><i class="icon-edit"></i> 开机</a>
                          <a href="__URL__/telecom_bootup/access_number/{$vo['card_id']}/yunying_name/{$yunying['name']}/jiekou_name/close"   class="btn btn-primary" target="dialog"  mask="true"   width="250" height="100" ><i class="icon-edit"></i> 关机</a>
                          <a href="__URL__/internet_choose/access_number/{$vo['card_id']}/yunying_name/{$yunying['name']}/jiekou_name/DEL"   class="btn btn-primary" target="dialog"  mask="true"   width="250" height="100" ><i class="icon-edit"></i> 断网</a>
                          <a href="__URL__/internet_choose/access_number/{$vo['card_id']}/yunying_name/{$yunying['name']}/jiekou_name/ADD"   class="btn btn-primary" target="dialog"  mask="true"   width="250" height="100" ><i class="icon-edit"></i> 取消断网</a>
                          <a href="__URL__/see_taocan/access_number/{$vo['card_id']}/yunying_name/{$yunying['name']}/jiekou_name/ADD"   class="btn btn-primary" target="dialog"  mask="true"   width="250" height="100" ><i class="icon-edit"></i> 查看剩余套餐</a>
                          <elseif condition="$vo['yunying_id'] eq 2"/>
                      <!--    <a href="__URL__/yd_choose/access_number/{$vo['card_id']}/opttype/2"   class="btn btn-primary" target="dialog"  mask="true"   width="250" height="100" ><i class="icon-edit"></i> 开机</a>
                          <a href="__URL__/yd_choose/access_number/{$vo['card_id']}/opttype/1"   class="btn btn-primary" target="dialog"  mask="true"   width="250" height="100" ><i class="icon-edit"></i> 关机</a>
                          <a href="__URL__/yd_choose/access_number/{$vo['card_id']}/opttype/3"   class="btn btn-primary" target="dialog"  mask="true"   width="250" height="100" ><i class="icon-edit"></i> 断网</a>
                          <a href="__URL__/yd_choose/access_number/{$vo['card_id']}/opttype/4"   class="btn btn-primary" target="dialog"  mask="true"   width="250" height="100" ><i class="icon-edit"></i> 恢复断网</a>
                          <a href="__URL__/yd_choose/access_number/{$vo['card_id']}/opttype/5"   class="btn btn-primary" target="dialog"  mask="true"   width="250" height="100" ><i class="icon-edit"></i> 断网+恢复断网</a>-->
                          <else />
                      </if>

                    <!--  <a href="__URL__/see/access_number/{$vo['card_id']}/yunying_name/{$yunying['name']}"   class="btn btn-primary" target="dialog"  mask="true"   width="500" height="400" ><i class="icon-edit"></i> 查询</a>-->
                    </div>
                </td>
            </tr>
          </volist>
        </tbody>
    </table>
    <div class="panelBar">
        <div class="pages pull-left">
            <span>共 {$totalCount} 条</span>
        </div>
        <div class="pagination-box" targettype="navTab" totalCount="{$totalCount}" numPerPage="{$numPerPage}" pageNumShown="10" currentPage="{$currentPage}">
        </div>
    </div>
</div>